package com.devbobcorn.misaka.entities;

import com.devbobcorn.misaka.Misaka;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.minecraft.entity.EntityClassification;
import net.minecraft.entity.EntityType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.registries.IForgeRegistry;

@EventBusSubscriber(modid = Misaka.MODID, bus = EventBusSubscriber.Bus.MOD)
public final class ModEntityType {
    public static final Logger LOGGER = LogManager.getLogger();
    
    public static EntityType<CoinEntity> COIN_TYPE;

    @SubscribeEvent
    public static void registerEntityTypes(RegistryEvent.Register<EntityType<?>> event) {
        LOGGER.debug("Manually registering entity types");

        COIN_TYPE = EntityType.Builder.<CoinEntity>of(CoinEntity::new, EntityClassification.MISC).sized(0.25F, 0.25F).clientTrackingRange(4).updateInterval(10).build(Misaka.MODID + ":coin");

        IForgeRegistry<EntityType<?>> reg = event.getRegistry();
        reg.register(COIN_TYPE.setRegistryName(Misaka.MODID, "coin"));
    }

}
